<html>

<head>
<title>testsuite</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">

<script type="text/javascript" src="../javascript/EWGL_math.js"></script>
<script type="text/javascript" src="../javascript/mjs.js"></script>
<script type="text/javascript" src="../javascript/sylvester.js"></script>
<script type="text/javascript" src="../javascript/glUtils.js"></script>

<script type="text/javascript" src="../javascript/testEWGL.js"></script>
<script type="text/javascript" src="../javascript/testmjs.js"></script>
<script type="text/javascript" src="../javascript/testsylvester.js"></script>

<script>

function go() {
	const COUNT = 200000;
	
	document.getElementById('log').innerHTML += "EWGL multiply: " + TestEWGL.multiply(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "mjs multiply: " + Testmjs.multiply(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "mjs1 multiply: " + Testmjs.multiply1(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester multiply: " + Testsylvester.multiply(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";

	document.getElementById('log').innerHTML += "EWGL inverse: " + TestEWGL.inverse(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "mjs inverse: " + Testmjs.inverse(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester inverse: " + Testsylvester.inverse(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";
	
	document.getElementById('log').innerHTML += "EWGL dup: " + TestEWGL.duplicate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "mjs clone: " + Testmjs.duplicate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester clone: " + Testsylvester.duplicate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";
	
	document.getElementById('log').innerHTML += "EWGL transpose: " + TestEWGL.transpose(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "mjs transpose: " + Testmjs.transpose(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester transpose: " + Testsylvester.transpose(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";
	
	document.getElementById('log').innerHTML += "EWGL eql always true: " + TestEWGL.equal(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester eql always true: " + Testsylvester.equal(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";
	
	document.getElementById('log').innerHTML += "EWGL determinant: " + TestEWGL.determinant(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester determinant: " + Testsylvester.determinant(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";
	
	document.getElementById('log').innerHTML += "EWGL translate: " + TestEWGL.translate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "mjs translate: " + Testmjs.translate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester translate: " + Testsylvester.translate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";
	
	document.getElementById('log').innerHTML += "EWGL rotate: " + TestEWGL.rotate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "mjs rotate: " + Testmjs.rotate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester rotate: " + Testsylvester.rotate(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";
	
	document.getElementById('log').innerHTML += "EWGL setElements: " + TestEWGL.setelements(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "mjs setElements: " + Testmjs.setelements(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "sylvester setelements: " + Testsylvester.setelements(COUNT) + " ms<br>";
	
	document.getElementById('log').innerHTML += "=============================================================== <br>";
	
/*
	t0 = Date.now();
    for (var i = 0; i < COUNT; ++i) {
		m4x4.makePerspective(45,1,1,100);
    }
    t1 = Date.now();
	document.getElementById('log').innerHTML += "makePerspective: " + (t1-t0) + "ms<br>";
*/}	
</script>

</head>


<body onload="go()">
<div id="log"></div> 

</body>

</html>
